import React from 'react'
import { Descriptions, Col, Row, } from "antd";
import { Decimal } from 'decimal.js';

export default function MemberInfo(props) {
  const data = props.orderInfo // 组件传参

  const payWay = (data) => {
    let label = ''
    switch (data) {
      case "WeChat":
        label = "微信";
        break;
      case "Alipay":
        label = "支付宝";
        break;
      case "YsPay":
        label = "银行卡";
        break;

      default:
        break;
    }
    return label
  }

  return (
    <div>
      <Descriptions style={{ marginTop: 20,marginLeft: 0 }} layout="vertical" bordered column={4}>
        <Descriptions.Item label="收货人信息">
          <Row>
            <Col  >收货人：</Col>
            <Col >{data.memberName}</Col>
          </Row>
          <Row>
            <Col  >联系电话：</Col>
            <Col >{data.memberPhone}</Col>
          </Row>
          <Row>
            <Col >收货地址：</Col>
            <Col >{data.memberAddress}</Col>
          </Row>
        </Descriptions.Item>
        <Descriptions.Item label="付款信息">
          <Row>
            <Col >付款方式：</Col>
            <Col >{payWay(data.payWay)}</Col>
          </Row>
          <Row>
            <Col >付款时间：</Col>
            <Col >{data.payTime}</Col>
          </Row>
        </Descriptions.Item>
        <Descriptions.Item label="买家信息">
          <Row>
            <Col >买家ID：</Col>
            <Col >{data.memberId}</Col>
          </Row>
          <Row>
            <Col >买家昵称：</Col>
            <Col >{data.buyerName}</Col>
          </Row>
        </Descriptions.Item>
        {/*<Descriptions.Item label="订单金额">*/}
        {/*  <Row>*/}
        {/*    <Col >订单实付金额：</Col>*/}
        {/*    <Col >{data.orderPayPrice ? '￥' + Decimal(data.orderPayPrice).div(Decimal(100)).toNumber().toFixed(2) : '￥0.00'}</Col>*/}
        {/*  </Row>*/}
        {/*  <Row>*/}
        {/*    <Col >订单退款金额：</Col>*/}
        {/*    <Col >{data.orderSalesReturnPrice ? '￥' + Decimal(data.orderSalesReturnPrice).div(Decimal(100)).toNumber().toFixed(2) : '￥0.00'}</Col>*/}
        {/*  </Row>*/}
        {/*  <Row>*/}
        {/*    <Col >已结算金额：</Col>*/}
        {/*    <Col >{data.practicalStorePrice ? '￥' + Decimal(data.practicalStorePrice).div(Decimal(100)).toNumber().toFixed(2) : '￥0.00'}</Col>*/}
        {/*  </Row>*/}
        {/*  <Row>*/}
        {/*    <Col >平台佣金：</Col>*/}
        {/*    <Col >{data.practicalStorePrice ? '￥' + Decimal(data.practicalStorePrice).div(Decimal(100)).toNumber().toFixed(2) : '￥0.00'}</Col>*/}
        {/*  </Row>*/}
        {/*</Descriptions.Item>*/}
      </Descriptions>
    </div>
  )
}
